<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
  <style>
      body{
          font: 12px "simhei", Arial, Helvetica, sans-serif;
          color: #666;
      }
      .el-header{
          background-color: #64a8d5;
          color: #000;
          text-align: left;
          line-height: 100px;
          font-size: 32px;
          font-weight: bold;
      }
  </style>
</head>
<body>
<div id="app">
    <el-container>
        <el-header height="100px">达内后台管理系统</el-header>
        <el-container>
            <el-aside width="250px">
                <el-menu
                        :default-active="activeIndex"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose"
                        background-color="#545c64"
                        text-color="#fff"
                        active-text-color="#ffd04b">
                    <el-submenu index="1">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>员工管理</span>
                        </template>
                        <el-menu-item index="1-1">员工列表</el-menu-item>
                        <el-menu-item index="1-2">添加员工</el-menu-item>
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>部门管理</span>
                        </template>
                        <el-menu-item index="2-1">部门列表</el-menu-item>
                        <el-menu-item index="2-2">添加部门</el-menu-item>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-main>
                <el-row>
                    <el-col span="24"><h1>员工列表</h1></el-col>
                </el-row>
                <el-row>
                    <el-col span="24">
                        <template>
                            <el-table :data="tableData" stripe style="width: 100%">
                                <el-table-column type="index" label="序号" width="90">
                                </el-table-column>
                                <el-table-column prop="name" label="姓名" width="180">
                                </el-table-column>
                                <el-table-column prop="sal" label="工资" width="180">
                                </el-table-column>
                                <el-table-column prop="job" label="职位" width="180" >
                                </el-table-column>
                                <el-table-column  label="操作">
                                    <template slot-scope="scope">
                                        <el-button size="mini"
                                                   @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                                        <el-button size="mini" type="danger"
                                                   @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </template>
                    </el-col>
                </el-row>
            </el-main>
        </el-container>
    </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
 let v = new Vue({
    el: '#app',
    data: function() {
      return {
          activeIndex:"1",
          tableData: [
              {name:"刘备",sal:4000,job:"销售"},
              {name:"关羽",sal:5000,job:"销售"},
              {name:"张飞",sal:6000,job:"销售"},
              {name:"诸葛亮",sal:7000,job:"销售"}
        ]
      }
    },
   methods:{
       handleOpen(key, keyPath) {
           console.log(key, keyPath);
       },
       handleClose(key, keyPath) {
           console.log(key, keyPath);
       },
       handleEdit(index, row) {
           console.log(index, row);
       },
       handleDelete(index, row) {
           console.log(index, row);
       }
   }
  })
</script>
</html>